package com.share.dao.attach.advertise.impl;

import java.util.LinkedHashMap;
import java.util.List;

import org.springframework.stereotype.Component;

import com.share.bean.attach.advertise.PositionItem;
import com.share.commons.base.dao.BaseDaoSupport;
import com.share.dao.attach.advertise.PositionItemDao;

@Component
public class PositionItemImpl extends BaseDaoSupport<PositionItem> implements PositionItemDao {

	@Override
	public void deletePositionItemDao(int id) throws RuntimeException {
		this.deleteObject(PositionItem.class, id) ;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<PositionItem> findAllPositionItemDao(String hql,String whereHQL,List<Object> param,LinkedHashMap<String , String> orderby)
			throws RuntimeException {
		
		return  (List<PositionItem>) this.find(hql, whereHQL, param, orderby) ;
	}

	@Override
	public PositionItem loadByIdPositionItemDao(int id) throws RuntimeException {
		
		return this.loadById(PositionItem.class, id) ;
	}

	@Override
	public void savePositionItemDao(PositionItem pi) throws RuntimeException {
		this.saveObject(pi) ;
	}

	@Override
	public void updatePositionItemDao(PositionItem pi) throws RuntimeException {
		
		this.updateObject(pi) ;
	}

}
